#include<iostream>
#include<iomanip>
#include <random>

using namespace std;

int main()
{
    int n,m;
    int min= 0,max = 99;//设置范围
    random_device seed;//硬件生成随机数种子
	ranlux48 engine(seed());//利用种子生成随机数引擎
    uniform_int_distribution<> distribute(min, max);//设置随机数范围，并为均匀分布
    cout<<"please enter the numbers of lines:";
    cin>>n;
    cout<<"please enter the numbers of columns:";
    cin>>m;
    int array[n][m];
    cout<<"初始矩阵:"<<endl;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            array[i][j] = distribute(engine);
            cout<<setw(2)<<array[i][j]<<" ";
        }
        cout<<endl;
    }
    cout<<"转置矩阵:"<<endl;
    for(int i=0;i<m;i++)
    {
        for(int j=0;j<n;j++)
        {
            cout<<setw(2)<<array[j][i]<<" ";
        }
        cout<<endl;
    }
    return 0;
}